/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package HangHoa;

import java.util.Vector;

/**
 *
 * @author Tuan
 */
public class SanPham {
    private String maHH;
    private String tenHH;
    private String nhaSX;
    private String chatLieu;
     private double giaNhap;
    private double giaBan;
    private int sL;
    private String donVi;
    
    private String ghiChu;
    public SanPham() {
    }

    public SanPham(String maHH, String tenHH, String nhaSX, double giaNhap, double giaBan, String chatLieu) {
        this.maHH = maHH;
        this.tenHH = tenHH;
        this.nhaSX = nhaSX;
        this.giaNhap = giaNhap;
        this.giaBan = giaBan;
        this.chatLieu = chatLieu;
    }
    public SanPham(String str[]){
        this.maHH = str[0];
        this.tenHH = str[1];
        this.nhaSX = str[2];
        this.chatLieu = str[3];
        this.giaNhap = Double.parseDouble(str[4]);
        this.giaBan =Double.parseDouble(str[5]);
        this.sL = Integer.parseInt(str[6]);
        this.donVi=str[7];
        
    }
    public void setMaHH(String maHH) {
        this.maHH = maHH;
    }

    public void setTenHH(String tenHH) {
        this.tenHH = tenHH;
    }

    public void setNhaSX(String nhaSX) {
        this.nhaSX = nhaSX;
    }

    public void setsL(int sL) {
        this.sL = sL;
    }

    public void setGiaNhap(double giaNhap) {
        this.giaNhap = giaNhap;
    }

    public void setGiaBan(double giaBan) {
        this.giaBan = giaBan;
    }

    public void setChatLieu(String chatLieu) {
        this.chatLieu = chatLieu;
    }

    public void setGhiChu(String ghiChu) {
        this.ghiChu = ghiChu;
    }

    public void setDonVi(String donVi) {
        this.donVi = donVi;
    }
    
//----------------------------------
    public String getMaHH() {
        return maHH;
    }

    public String getTenHH() {
        return tenHH;
    }

    public String getNhaSX() {
        return nhaSX;
    }

    public int getsL() {
        return sL;
    }

    public double getGiaNhap() {
        return giaNhap;
    }

    public double getGiaBan() {
        return giaBan;
    }

    public String getChatLieu() {
        return chatLieu;
    }

    public String getGhiChu() {
        return ghiChu;
    }

    public String getDonVi() {
        return donVi;
    }
    public Vector toVector() {
        Vector vT = new Vector();
        vT.add(this.getMaHH().toString());
        vT.add(this.getTenHH().toString());
        vT.add(this.getNhaSX().toString());
        vT.add(this.getChatLieu().toString());
        vT.add(this.getGiaNhap()+"");
        vT.add(this.getGiaBan()+"");
        vT.add(this.getsL()+"");
        vT.add(this.getDonVi().toString());
        vT.add(this.getGhiChu());
        return vT;    }
    
}
